var express = require('express');
var router = express.Router();
var Comment = require('../models/comment.js');

router.get('/',function(req,res,next){
    Comment.calcCommentsNumForAId(function(err,commentsNum){
        if(err){
            console.log('err'+err);
            res.json({"success":false,message:'获取评论失败',commentsNum:[]});
        }else{
            res.json({"success":true,message:'获取评论成功',commentsNum:commentsNum});
        }
    })
});

module.exports = router;
